
<%
	// Get the name of the current page.
	//String sPath = window.location.pathname;
	String sPath = request.getRequestURI();
	String sPage = sPath.substring(sPath.lastIndexOf('/') + 1);

	/*
	 * Determine if this is a functional page. A functional page is a page that
	 * deals with the actual auctions whereas a non functional page is external to
	 * the auctions such as a login page.
	 */
	boolean functional = !sPage.equalsIgnoreCase("register.jsp") && !sPage.equalsIgnoreCase("login.jsp");

	// Place the taskbar.
	out.println("<div class=\"padding-5px\"><div id=\"taskbar\">");
	if (functional) {
		// The full taskbar only appears onfunctional pages.
		String user = (String) session.getAttribute("logged_user");
		if (user == null) {
			// If there is no user logged in ask the user to login or register.
			out.println("Hi! " + "<a href=\"login.jsp\"> Sign in</a> or " + "<a href=\"register.jsp\"> Register</a>");
		} else {
			// If there is a user logged in, present the user with useful links.
			out.println(user + " (<a href=\"logout.jsp\">Logout</a>)");
		}
	}
	// Place a help menu.
%>
<ul class="cssMenu right">
	<li><a href="help.jsp">Help</a>
		<ul>
			<li class="sub"><a href="help.jsp#who_we_are">Who We Are</a></li>
			<li class="sub"><a href="help.jsp#getting_started">Getting Started</a></li>
			<li class="sub"><a href="help.jsp#dashboard_explained">Dashboard Help</a></li>
			<li class="sub"><a href="help.jsp#customer_help">Customer Help</a></li>
			<li class="sub"><a href="help.jsp#employee_help">Employee Help</a></li>
			<li class="sub"><a href="help.jsp#manager_help">Manager Help</a></li>
		</ul></li>
</ul>
<%
	out.println("<br /><br /><a href=\"index.jsp\" class=\"button\">Home</a>");
	out.println("</div>");

	// Place the website's logo on the page.
	// 	out.println("<a href=\"index.jsp\">" + "<img id=\"logo\" src=\"images/logo.png\" alt=\"Logo\">" + "</img></a>");

	// Place a search bar on functional pages.
	// 	if (functional) {
	// 		out.println("<form id=\"search-bar\" class=\"right margin-top-3pct\">"
	// 				+ "<input id=\"search-term\" name=\"search-bar\" type=\"text\" />"
	// 				+ "<select id=\"search-category\" class=\"margin-left-1pct\">" + "<option value=\"audi\">Audi</option>" + "</select>"
	// 				+ "<a href=\"#\" class=\"margin-left-1pct button\" onclick=\"return loginClicked()\">Search</a>" + "</form>");
	// 	}
	out.println("</div>");
%>
